package com.zhuoshi.converter;

import java.text.SimpleDateFormat;
import java.util.Date;

import org.springframework.core.convert.converter.Converter;

public class DateConverter implements Converter<String, Date>{

	public Date convert(String source) {
		SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy-MM-dd");
		try{
			Date date = simpleDateFormat.parse(source);
			return date;
		}catch(Exception ex){
			ex.printStackTrace();
		}
		return null;
	}

}
